package com.xuetang9.t9.xinhuaxia.mappers;

import com.xuetang9.t9.xinhuaxia.beans.SocialPicture;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface SocialPictureMapper extends Mapper<SocialPicture> {
    @Select("select * from social_picture where p_id=#{p_id}")
    @Results(
            {
            @Result(column="p_id",property="pId"),
            @Result(column="p_userid",property="pUserid"),
            @Result(column="p_photopath",property="pPhotopath")
            })
    List<SocialPicture> queyByPublishId(@Param("p_id")int p_id);

    @Select("select * from social_picture where p_userid=#{p_userid}")
    @Results(
            {
             @Result(column="p_id",property="pId"),
             @Result(column="p_userid",property="pUserid"),
             @Result(column="p_photopath",property="pPhotopath")
            })
    List<SocialPicture> queryByUserId(@Param("p_userid")int p_userid);
}